<?php
function system_log($str) {
    $date = date('Y-m-d');
    $path = G_CACHES.'caches_log'.'/system.log.'.$date.'.php';
    if (!file_exists($path)) {
        $log = "<?php exit; ?> \n\n\n\n";
        file_put_contents($path, $log);
    }
    if (!is_writable($path)) {
        exit("system.log.{$date}.php 没有写入权限");
    }
    $date = date('Y-m-d H:i:s');
    $log = "[ $date ] ".$str;
    $log .= " \n";
    file_put_contents($path, $log, FILE_APPEND);
}